﻿/*
 ***************************************************************************
 * Microsoft Visual C# .NET
 * 名称：       App_Input_HappyEvaluateStatForm
 * 类型：       控制层
 * 功能说明：   快乐管家-活动计划评价统计页面
 * 作者：       郭晓庆
 * 创建日期：   2007/09/12
 * 修改日期     修改者      修改内容
 * 
 * 
 * ---
 ***************************************************************************
*/
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Shpm.App.Input.Dao;
using Shpm.App.Input.Bean;
using Shpm.App.Commons.Db.Beans.Master;
using Shpm.System;
using log4net;
using Shpm.App.Commons.Utils;

public partial class App_Input_HappyEvaluateStatForm : System.Web.UI.Page
{
    // log
    protected static ILog log = LogManager.GetLogger(typeof(App_Input_HappyEvaluateStatForm));
  
    // page load
    protected void Page_Load(object sender, EventArgs e)
    {        
        if (!Page.IsPostBack)
        {
            // 保存接收的参数
            ViewState["InpActName"] = Convert.ToString(Context.Items["InpActName"]);
            ViewState["InpActType"] = Convert.ToString(Context.Items["InpActType"]);
            ViewState["InpActStat1"] = Convert.ToString(Context.Items["InpActStat1"]);
            ViewState["InpActStat2"] = Convert.ToString(Context.Items["InpActStat2"]);
            ViewState["InpBeginDate"] = Convert.ToString(Context.Items["InpBeginDate"]);
            ViewState["InpEndDate"] = Convert.ToString(Context.Items["InpEndDate"]);

            ViewState["HidActName"] = Convert.ToString(Context.Items["HidActName"]);
            ViewState["HidActType"] = Convert.ToString(Context.Items["HidActType"]);
            ViewState["HidActStat1"] = Convert.ToString(Context.Items["HidActStat1"]);
            ViewState["HidActStat2"] = Convert.ToString(Context.Items["HidActStat2"]);
            ViewState["HidBeginDate"] = Convert.ToString(Context.Items["HidBeginDate"]);
            ViewState["HidEndDate"] = Convert.ToString(Context.Items["HidEndDate"]);
            ViewState["HidCommand"] = Convert.ToString(Context.Items["HidCommand"]);



            if (Context.Items.Contains("HidPageIndex"))
            {
                ViewState["HidPageIndex"] = Context.Items["HidPageIndex"];
            }
            //接收活动编号
            int actionId = Convert.ToInt32(Context.Items["ACTION_ID"]);
            this.labActinId.Text = Convert.ToString(actionId);




            //检索活动信息
            HappyPlanDao happyPlanDao = new HappyPlanDao();
            HappyPlanBean bean = new HappyPlanBean();


            bean.ActionId = actionId;
            bean = happyPlanDao.FindHappyPlanInfo(bean);
            //活动类型
            string evluateType = bean.ActionType;

            this.labActionName.Text = bean.ActionName;
            this.labRespPesonName.Text = bean.RespPesonName;
            this.labTypeName.Text = bean.TypeName;
            this.labActionDate.Text = DateUtils.convertToString((DateTime)bean.BespokeDate);
            this.labActionAddress.Text = bean.ActionAddress;     

            //评价统计
            HappyEvaluateDao happyEvaluateDao = new HappyEvaluateDao();
            ActionMemberAppraiseBean actionMemberAppraiseBean = new ActionMemberAppraiseBean();
            actionMemberAppraiseBean.ActionId = actionId;
            IList list = happyEvaluateDao.FindMemberAppraiseStat(actionMemberAppraiseBean);
            this.GridView1.DataSource = list;
            this.GridView1.DataBind();

        }
    }

    protected void back_Click(object sender, EventArgs e)
    {
        string url = "~/App/Input/HappyPlanSrhForm.aspx";

        // 回传接收的参数       
        Context.Items["InpActName"] = ViewState["InpActName"];
        Context.Items["InpActType"] = ViewState["InpActType"];
        Context.Items["InpActStat1"] = ViewState["InpActStat1"];
        Context.Items["InpActStat2"] = ViewState["InpActStat2"];
        Context.Items["InpBeginDate"] = ViewState["InpBeginDate"];
        Context.Items["InpEndDate"] = ViewState["InpEndDate"];

        Context.Items["HidActName"] = ViewState["HidActName"];
        Context.Items["HidActType"] = ViewState["HidActType"];
        Context.Items["HidActStat1"] = ViewState["HidActStat1"];
        Context.Items["HidActStat2"] = ViewState["HidActStat2"];
        Context.Items["HidBeginDate"] = ViewState["HidBeginDate"];
        Context.Items["HidEndDate"] = ViewState["HidEndDate"];
        Context.Items["HidCommand"] = ViewState["HidCommand"];
        Context.Items["HidPageIndex"] = ViewState["HidPageIndex"];

        ControllerUtils.Transfer(Context, url, true);    
    }
}
